import * as types from './mutation-types'

export default {
  [types.SET_REPORT_HEADER_CONFIG] (state, { data }) {
    for (let type in state) {
      for (let reportType in state[type]) {
        if (state[type][reportType].tableHeader) {
          if (state[type][reportType].tableHeader.Type === data.reportType) {
            data.headers.map(header => {
              header.name = header.name.split('@')[0]
            })
            state[type][reportType].tableHeader.Config = data.headers
            return
          }
        }
      }
    }
  },
  [types.SET_CONFIG_HEADER_BOOL] (state, { data }) {
    state.setConfigHeaderBool = data.configBool
  }
}
